package documentosRepositorio;

import java.io.*;
import antlr.*;

public class MainDocRep {
	public static void main(String[] args) {
	
		try
		{
			/*FileInputStream fis = new FileInputStream(args[0]);
			Analex analex = new Analex(fis);
			
			
			System.out.print("Analisis lexico\n");
			
			Token token = analex.nextToken();
			
			while(token.getType() != Token.EOF_TYPE)
			{
				System.out.println("Token "+token);
				
				token = analex.nextToken();
			}
			
			fis.close();*/
			
			FileInputStream fis1= new FileInputStream(args[0]);
			Analex analex1 = new Analex(fis1);
			
			Anasint anasint = new Anasint(analex1);
			anasint.repositorio();
			System.out.println(anasint.toString());
			
			fis1.close();
		}
		catch(ANTLRException ae)
		{
			System.out.println("ANTLR "+ae.getMessage());
		}
		catch (FileNotFoundException e)
		{
			System.out.println("Fichero no encotrado "+args[0]);
		}
		catch(IOException fc){
			System.out.print("Error al cerrar el fichero");
		}
	}
}
